{extend name="layout/main-block" /}
<!-- main content start -->
{block name="content"}
<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <ol class="breadcrumb">
                <li class="h4"><a href="">添加视频</a></li>
            </ol>

        </div>
        <div class="row content-main">
            <div class="col-sm-12 col-md-6">
                <form class="form-horizontal" action="{:url('backend/voices/voices_create')}" enctype="multipart/form-data" method="post">
                    <div class="form-group ">
                        <label class="col-sm-3 col-md-4 col-lg-3 control-label">视频分类</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <select name="type_id" id="nav-select" class="form-control">
                                {volist name="type" id="v" empty="$empty" }
                                <option value="{$v.type_id}">{$v.remark_cn}</option>
                                {/volist}
                            </select>
                        </div>
                    </div>
                    <input type="hidden" name="tab_id"  id="inputTab_id" value="{$tab_id}">
                    <div class="form-group">
                        <label for="inputVio_name_cn" class="col-sm-3 col-md-4 col-lg-3 control-label">视频标题中文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="vio_name_cn" class="form-control" id="inputVio_name_cn" placeholder="视频标题中文...">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputVio_name_en" class="col-sm-3 col-md-4 col-lg-3 control-label">视频标题英文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="vio_name_en" class="form-control" id="inputVio_name_en" placeholder="视频标题英文...">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputVio_intro_cn" class="col-sm-3 col-md-4 col-lg-3 control-label">视频简介中文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="vio_intro_en" class="form-control" id="inputVio_intro_cn" placeholder="视频简介中文...">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputVio_intro_en" class="col-sm-3 col-md-4 col-lg-3 control-label">视频简介英文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="vio_intro_en" class="form-control" id="inputVio_intro_en" placeholder="视频简介英文...">
                        </div>
                    </div>
                    <div id="img" class="form-group">
                        <label for="inputImg_url" class="col-sm-3 col-md-4 col-lg-3 control-label">视频图片</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input id="inputImg_url" name="image[]" type="file"  value="浏览" >
                        </div>
                    </div>
                    <div class="form-group ">
                        <label class="col-sm-3 col-md-4 col-lg-3 control-label">视频</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <select id="local" style="display: block" name="choose" id="choose_select" class="form-control">
                                {volist name="choose" id="v" empty="$empty" }
                                <option value="{$v}">{$v}</option>
                                {/volist}
                            </select>
                            <input style="display: none" type="text" name="vioce_url" class="form-control" id="inputVioce_url" placeholder="站外视频链接...">
                        </div>
                    </div>

                    <!--<div class="form-group">
                        <label for="inputVio_intro_cn" class="col-sm-3 col-md-4 col-lg-3 control-label">视频</label>
                            <div class="col-sm-9 col-md-8  col-lg-9">
                                &lt;!&ndash;<input class="form-control" id="inputVioce_url" name="vioce_url" type="text">
                                <button type="button" class="btn btn-default" id="choose" >选择</button>&ndash;&gt;
                            </div>
                    </div>-->
                    <div class="form-group">
                        <div class="col-sm-offset-3 col-sm-9">
                            <button type="submit" class="btn btn-primary">创 建</button>
                            <input type="hidden" id="img_type" name="img_type" value="4">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
</section>
{/block}

{block name="javascript"}
<script>
    $(function (){
        $('#nav-select').bind('change',function() {
            var type_id =$('#nav-select').val();
            //console.log(team);
            if(type_id ==3){
                $("#inputVioce_url").hide();
                $("#local").show();
            }else if(type_id == 4){
                $("#local").hide();
                $("#inputVioce_url").show();
            }
        });
    });
</script>
{/block}

